package cc.dullsky.lucene;

import java.util.HashSet;

import com.jfinal.plugin.IPlugin;

import cc.dullsky.lucene.model.ConfigBean;
import cc.dullsky.lucene.model.IndexConfig;

public class LucenePlugin implements IPlugin {
	private String indexPath;
	private String indexName;

	public LucenePlugin(String indexPath, String indexName) {
		this.indexPath = indexPath;
		this.indexName = indexName;
	}

	@Override
	public boolean start() {
		HashSet<ConfigBean> set = new HashSet<ConfigBean>();
		ConfigBean configBean = new ConfigBean();
		configBean.setIndexPath(indexPath);
		configBean.setIndexName(indexName);
		set.add(configBean);
		IndexConfig.setConfig(set);
		System.out.println("lucene_ok-------------------");
		return true;
	}

	@Override
	public boolean stop() {
		return true;
	}

}
